package com.wunu.smartlock1.net.api;

import com.wunu.smartlock1.net.param.AddLockParam;
import com.wunu.smartlock1.net.param.BindLockParam;
import com.wunu.smartlock1.net.param.ChangeLockMemberParam;
import com.wunu.smartlock1.net.param.GrantMemberParam;
import com.wunu.smartlock1.net.response.ApiNormalResponse;
import com.wunu.smartlock1.net.response.ApiRegistResponse;
import com.wunu.smartlock1.net.response.ApiSimpleResponse;
import com.wunu.smartlock1.net.response.BaseCodeInfo;
import com.wunu.smartlock1.net.response.BindLockResult;
import com.wunu.smartlock1.net.response.LockInfo;
import com.wunu.smartlock1.net.response.LockItem;
import com.wunu.smartlock1.net.response.LockMemberList;
import com.wunu.smartlock1.net.response.LockQrCode;
import com.wunu.smartlock1.net.response.MemberRequestInfo;

import java.util.List;

import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

public interface LockManageApi {

    /**
     * 绑定新锁
     */
    @POST("bindLock")
    Call<ApiNormalResponse<BindLockResult>> bindLock(@Body BindLockParam param);

    /**
     * 删除门锁
      * @param lockId
     * @return
     */
    @GET("deleteLock")
    Call<ApiRegistResponse> deleteLock(@Query("lockId") long lockId);
    /**
     * 删除门锁
     * @param lockId
     * @return
     */
    @GET("unbindLock")
    Call<ApiRegistResponse> unbindLock(@Query("lockId") long lockId);


    /**
     * 查看锁的二维码信息
     *
     * @param lockId
     * @return
     */
    @GET("wxQrcode")
    Call<ApiNormalResponse<LockQrCode>> getLockQrCode(@Query("lockId") long lockId);

    /**
     * 查看锁成员列表信息
     *
     * @return
     */
    @GET("lockMember")
    Call<ApiNormalResponse<LockMemberList>> getLockMemberList(@Query("lockId") long lockId);

    /**
     * 申请锁成员
     */
    @POST("addLock")
    Call<ApiSimpleResponse> applyForLock(@Body AddLockParam param);

    /**
     * 查看锁成员申请信息
     */
    @GET("grantMember")
    Call<ApiNormalResponse<MemberRequestInfo>> getMemberRequestInfo(@Query("memberId") long memberId);

    /**
     * 处理锁成员申请，授权锁成员
     */
    @POST("grantMember")
    Call<ApiSimpleResponse> grantMemberInfo(@Body GrantMemberParam param);

    /**
     * 管理锁成员（删除、启用等）
     */
    @POST("changeLockMember")
    Call<ApiSimpleResponse> changeLockMember(@Body ChangeLockMemberParam param);

    /**
     * 获取用户注册锁列表，不包括临时锁
     *
     * @return
     */
    @GET("lockList")
    Call<ApiNormalResponse<List<LockItem>>> getLockList();

    /**
     * 扫描二维码，获取锁信息
     *
     * @return
     */
    @GET("findLock")
    Call<ApiNormalResponse<LockInfo>> getLockInfo(@Query("lockId") long lockId);

    /**
     * 获取锁的baseCode
     *
     * @return
     */
    @GET("lockBasecode")
    Call<ApiNormalResponse<BaseCodeInfo>> getLockBaseCode(@Query("lockId") long lockId);
}